export default {
  required: {
    regexp: /[\S]/,
    message: '必填'
  }, // 非空（数组非空）
  chinese: {
    regexp: /^[\u4e00-\u9fa5]+$/,
    message: '必须为中文'
  }, // 中文
  phone: {
    regexp: /^[1][3,4,5,6,7,8,9][0-9]{9}$/,
    message: '手机号必须由1开头的11位数字'
  }, // 手机号
  tel: {
    regexp: /^((\d{3,4})|\d{3,4}-|\s)?\d{7,14}$/,
    message: '座机号'
  }, // 座机号
  telephone: {
    regexp: /^(((0\d{2,3}[-]?)?\d{7,8})|(1\d{10}))$/,
    message: '手机号或者座机号'
  }, // 座机和手机
  hex: {
    regexp: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,
    message: '十六进制颜色'
  }, // 十六进制颜色
  digit: {
    regexp: /^\d+$/,
    message: '自然数'
  }, // 自然数
  number: {
    regexp: /^(-?(\d+\.)?\d+)$/,
    message: '数字'
  }, // 数字
  IDCard: {
    regexp:
      /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/,
    message: '身份证'
  }, // 身份证
  money: {
    regexp:
      /(^[1-9](\d+)?(\.\d{1,2})?$)|(^[1-9]$)|(^\d\.[1-9]{1,2}$)|(^\d\.[0]{1}[1-9]{1}$|(^\d\.[1-9]{1}[0]{1}$)$)/,
    message: '货币'
  }, // 货币
  password: {
    regexp: /^.{6,}$/,
    message: '密码'
  },
  // googleCode: /^(\d{6})$/,
  // messageCode: /^(\d{6})$/,
  // bankCode: /^(\d{10,19})$/,
  email: {
    regexp:
      /^([a-zA-Z0-9_\-.+]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/,
    message: '邮箱'
  },
  // email:
  //   /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
  url: {
    regexp: new RegExp(
      '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$',
      'i'
    ),
    message: '网址'
  },
  carNo: {
    // regexp: /^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/,
    regexp:
      /^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/,
    message: '车牌号'
  },
  commonCarNo: {
    regexp: /^[\u4e00-\u9fa5]{1}[a-zA-Z]{1}[A-Za-z0-9]{4,6}[\u4e00-\u9fa5]?$/,
    message: '车牌号'
  }
}
